import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

//导入格式化时间的插件
import moment from 'moment'
//定义全局过滤器
Vue.filter('dateFormat',function(dataStr,pattern = "YYYY-MM-DD HH:mm:ss") {
    return moment(dataStr).format(pattern)
}) 

//导入vue-resource
import VueResource from 'vue-resource'
//安装vue-resource
Vue.use(VueResource)

//设置请求的根路径
Vue.http.options.root = 'http://47.89.21.179:8080'

import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'

import { Header, Swipe, SwipeItem, Button  } from  'mint-ui';
Vue.component(Header.name, Header);
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
Vue.component(Button.name, Button);

//导入路由模块
import router from './router.js'

import app from './App.vue';


var vm = new Vue({
    el: '#app',
    render: p=>p(app),//render会把el指定的容器中，所有的内容都清空覆盖，所以不哟啊把路由的router-view和router-link直接写到el所控制的el身上
    router: router//将路由对象挂载到vm身上
})